package com.example.blog.mapper;

import com.example.blog.entity.Category;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Optional;

@Mapper
public interface CategoryMapper {

    Category selectById(Long id);

    Optional<Category> selectByName(String name);

    List<Category> selectAll();

    int insert(Category category);

    int update(Category category);

    int deleteById(Long id);

    boolean existsByName(String name);

}